package org.hilo.boot.core.util;

import org.jretty.apibase.IMsg;
import org.hilo.boot.core.UT;
import org.hilo.boot.core.exception.AppException;

/**
 * 数据校验
 * @author zollty
 */
public abstract class Assert {

    public static void isBlank(String str, String message) {
        if (UT.Str.isBlank(str)) {
            throw new AppException(message);
        }
    }

    public static void isNull(Object object, String message) {
        if (object == null) {
            throw new AppException(message);
        }
    }
    
    public static void isBlank(String str, IMsg ec) {
        if (UT.Str.isBlank(str)) {
            throw new AppException(ec);
        }
    }

    public static void isNull(Object object, IMsg ec) {
        if (object == null) {
            throw new AppException(ec);
        }
    }
}
